package com.yc.demo.common;

import com.yc.demo.enums.ResponseEnum;

public class ResponseEntity<T> {

    private int status;

    private T result;

    private String msg;

    public ResponseEntity(String msg) {
        this.status = 200;
        this.msg = msg;
    }

    public ResponseEntity(ResponseEnum responseEnum) {
        this.status = responseEnum.getStatus();
        this.msg = responseEnum.getMsg();
    }

    public ResponseEntity(int status, T result, String msg) {
        this.status = status;
        this.result = result;
        this.msg = msg;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
